package com.js;

/**
 * 这是一个Phone的实体类
 */
public class Phone implements Comparable<Phone>{

    private String phoneNumber;

    private long number;

    private double balance;

    public Phone() {
    }

    public Phone(String phoneNumber, long number, double balance) {
        this.phoneNumber = phoneNumber;
        this.number = number;
        this.balance = balance;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public long getNumber() {
        return number;
    }

    public void setNumber(long number) {
        this.number = number;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }


    @Override
    public String toString() {
        return "Phone{" +
                "phoneNumber='" + phoneNumber + '\'' +
                ", number=" + number +
                ", balance=" + balance +
                '}';
    }

    public int compareTo(Phone o) {
        return balance>o.balance?-1:1;
    }



}
